﻿using System;
using System.Collections.Generic;
using System.Text;
using Persistence = Entersoft.Data.DotNetDAL.SQL.Persistence;

namespace BLL
{
    public class Bodega:Common
    {

        public static int ObtenerMaxId()
        {
            int retorno = 0;

            var objRP = new Entersoft.Data.DotNetResponse.SQL.Persistence { StoredProcedure = "SP_ObtMax_ID2" };
            objRP.AddParametro("TBL_Bodega");
            objRP.AddParametro("codigo_bodega");
            using (var objConn = new Persistence(false, ConnDB))
            {
                objConn.ExecuteDataTable(ref objRP);

                if (!objRP.TieneErrores)
                    retorno = (int)objRP.DataTable.Rows[0]["Val_Max"];
            }

            return retorno;
        }
    }
}
